# Pascal's Triangle

# prede-fined line 1: 
# 0 at the beginning and the end, makes for loop easier (out-of-bound accessing)
previous_line = [0, 1, 0] 

# print n rows of the pascal's triangle
n = int(input("Input n: "))

# loop for n times
for i in range(1, n + 1):
    new_line = [0]
    for j in range(1, i + 1):
        # print line i:
        print(previous_line[j], end='\t')
        # generate line i + 1:
        new_line.append(previous_line[j] + previous_line[j-1])
    print('')
    new_line += [1,0]
    previous_line = new_line
